
#If Not (PocketPC OrElse Smartphone) Then
<ComponentModel.DefaultProperty("data")> _
Public Class reverseInt32
#Else
Public Class reverseInt32
#End If
    Implements IComparable
    Public data As Int32

    Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
        Dim right As Int32 = CType(obj, reverseInt32).data
        Return -(data.CompareTo(right))
    End Function

    Public Sub New(ByVal i As Int32)
        data = i
    End Sub

    Public Sub New()
        data = 0
    End Sub

    Public Shared Widening Operator CType(ByVal i As Int32) As reverseInt32
        Return New reverseInt32(i)
    End Operator

    Public Shared Widening Operator CType(ByVal i As reverseInt32) As Int32
        Return i.data
    End Operator
End Class

#If Not (PocketPC OrElse Smartphone) Then
<ComponentModel.DefaultProperty("data")> _
Public Class reverseInt64
#Else
Public Class reverseInt64
#End If
    Implements IComparable
    Public data As Int64

    Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
        Dim right As Int64 = CType(obj, reverseInt64).data
        Return -(data.CompareTo(right))
    End Function

    Public Sub New(ByVal i As Int64)
        data = i
    End Sub

    Public Sub New()
        data = 0
    End Sub

    Public Shared Widening Operator CType(ByVal i As Int64) As reverseInt64
        Return New reverseInt64(i)
    End Operator

    Public Shared Widening Operator CType(ByVal i As reverseInt64) As Int64
        Return i.data
    End Operator
End Class

#If Not (PocketPC OrElse Smartphone) Then
<ComponentModel.DefaultProperty("data")> _
Public Class reverseDate
#Else
Public Class reverseDate
#End If
    Implements IComparable
    Public data As Date

    Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
        Dim right As Date = CType(obj, reverseDate).data
        Return -(data.CompareTo(right))
    End Function

    Public Sub New(ByVal i As Date)
        data = i
    End Sub

    Public Sub New()
        data = DateTime.Now
    End Sub

    Public Shared Widening Operator CType(ByVal i As Date) As reverseDate
        Return New reverseDate(i)
    End Operator

    Public Shared Widening Operator CType(ByVal i As reverseDate) As Date
        Return i.data
    End Operator

    Public Shared Operator +(ByVal left As reverseDate, ByVal right As reverseDate) As reverseDate
        Return New Date(left.data.Ticks + right.data.Ticks)
    End Operator

    Public Overrides Function ToString() As String
        Return Convert.ToString(data)
    End Function

    Public Overrides Function GetHashCode() As Integer
        Return data.GetHashCode()
    End Function
End Class
